<ion-header>
  <ion-navbar>
    <ion-title style="font-family: '微软雅黑'">计划详情<font size=3 style="margin-left:65%" *ngIf="!this.isEdit" (click)="edit()">编辑</font><font size=3 style="margin-left:65%" *ngIf="this.isEdit" (click)="exitEdit()">取消</font></ion-title>
  </ion-navbar>
</ion-header>

<ion-content style="background-color:#efefef;font-family:'微软雅黑'" padding>
  <ion-list no-lines>
  <ion-item>
    <ion-label fixed>主题</ion-label>
    <ion-input type="text" [(value)]="this.plan.pName" [(ngModel)]="this.plan.pName" [(readonly)]="!this.isEdit"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label fixed>要求</ion-label>
    <ion-input type="text" [(value)]="this.plan.description" [(ngModel)]="this.plan.description" [(readonly)]="!this.isEdit"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label fixed>总天数</ion-label>
    <ion-input type="text" [(value)]="this.plan.totalNum" [(ngModel)]="this.plan.totalNum" [(readonly)]="!this.isEdit"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label fixed>已签到天数</ion-label>
    <ion-input type="text" [(value)]="this.plan.signedNum" [(ngModel)]="this.plan.signedNum" readonly=true></ion-input>
  </ion-item>
  <ion-item>
  <ion-label fixed>愿望</ion-label>
  <ion-input type="text" [(value)]="this.plan.wName" [(ngModel)]="this.plan.wName" [(readonly)]="!this.isEdit"></ion-input>
</ion-item>
  </ion-list>
  <ion-grid *ngIf="!this.isEdit">
    <ion-row>
      <ion-col *ngFor="let item of signList;let i = index" col-3><button ion-fab *ngIf="signList[i].flag == 1"><ion-icon name="checkmark"></ion-icon></button><button ion-fab *ngIf="signList[i].flag == 0" color=light><ion-icon name="checkmark"></ion-icon></button></ion-col>
    </ion-row>
  </ion-grid>
<ion-item-group>
  <ion-item-divider>
    <ion-label>提醒</ion-label>
    <ion-toggle [(ngModel)]="this.isRemindingOpen"></ion-toggle>
  </ion-item-divider>
    <ion-item *ngIf="this.isEdit || this.isRemindingOpen">
    <ion-label>时间:</ion-label><ion-datetime [(ngModel)]="this.plan.time" displayFormat="HH:mm" pickerFormat="HH:mm" cancelText="取消" doneText="确定"></ion-datetime>
    </ion-item>
    <ion-item *ngIf="this.isEdit || this.isRemindingOpen">
    <ion-label>闹铃:</ion-label>
      <ion-select [(ngModel)]="this.plan.bell">
      <ion-option value="里表">里表</ion-option>
      <ion-option value="嚎哭">嚎哭</ion-option>
      </ion-select>
    </ion-item>
</ion-item-group>
<button ion-button block *ngIf="this.isEdit&&!this.isAdd" (click)="update()">保存</button>
<button ion-button block *ngIf="this.isEdit&&this.isAdd" (click)="add()">添加</button>
<button ion-button block *ngIf="!this.isEdit&&this.plan.signedNum!=this.plan.totalNum" (click)="sign()">签到</button>
<button ion-button block color=light  *ngIf="!this.isEdit&&this.plan.signedNum==this.plan.totalNum">签到</button>

<!--<div style="height: 100%; width: 100%;  padding: 0px 20px 0px 0px; ">  
    <my-dygraph2></my-dygraph2>   
</div> -->
</ion-content>
